package com.fr.report.script.function;

import com.fr.report.script.Function;
import com.fr.report.script.Function.Type;
import com.fr.report.script.NormalFunction;
import com.fr.report.script.Primitive;

public class NVL extends NormalFunction
{
  public Object run(Object[] paramArrayOfObject)
  {
    for (int i = 0; i < paramArrayOfObject.length; ++i)
    {
      Object localObject = paramArrayOfObject[i];
      if ((localObject != Primitive.NULL) && (localObject != null))
      {
        if ((localObject instanceof String) && (((String)localObject).length() == 0))
          break label45:
        return localObject;
      }
    }
    label45: return Primitive.NULL;
  }

  public Function.Type getType()
  {
    return Function.OTHER;
  }

  public String getCN()
  {
    return "NVL(value1,value2,value3,...):在所有参数中返回第一个不是null的值value1:可以为任意数，也可以为null。\nvalue2:可以为任意数，也可以为null。\n示例:\nNVL(12,20)等于12。\nNVL(null,12)等于12。\nNVL(null,null)等于null。\nNVL(20,null)等于20。\nNVL(null,null,10)等于10。";
  }

  public String getEN()
  {
    return "";
  }
}